import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core';

@Component({
  selector: 'app-demo3',
  templateUrl: './demo3.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  styles: [
    `
      .inner-search {
        background: #eee;
      }
    `,
  ],
})
export class Demo3Component {
  loading = false;
  value = 'value';

  constructor(private cdr: ChangeDetectorRef) {}

  change(val) {
    this.loading = true;
    setTimeout(() => {
      this.loading = false;
      this.cdr.markForCheck();
    }, 500);
  }
}
